#ifndef MAP_HH
#define MAP_HH

#include "Room.hh"
#include "Player.hh"
#include "MonsterRoom.hh"
#include "RestRoom.hh"
#include "ShopRoom.hh"
#include "BossRoom.hh"
#include "TreasureRoom.hh"
#include "ForgeRoom.hh"
#include "LotteryRoom.hh"
#include <memory>

// This class represents the procedural tower map system in the game. It 
// manages the current room, room transitions, current layer, and tracks the 
// player's progression. And they are random

class Map {
public:
    Map();

    Room* getCurrentRoom() const;
    int getCurrentLayer() const;
    int getRoomsVisitedThisLayer() const;

    void moveInDirection(Player& player, bool forward);

    bool tryAPReset(Player& player);
    bool allAPResetsUsed() const;
    ~Map()=default;
    Map(const Map& other)=default;
    Map& operator=(const Map& other)=default;

private:
    std::unique_ptr<Room> currentRoom;
    int currentLayer = 1;
    int roomsVisitedThisLayer = 0;
    int apResetUsed = 0;
    const int maxApReset = 3;
    
    std::unique_ptr<Room> generateRandomRoom();
};

#endif
